# MIT License
# Copyright (c) 2024 light config  https://gitee.com/lsw-elecm/light_config
# 
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# 
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

# This file is automatically generated by the light config tool, do not modify this file


LC_TOPDIR = F:/learning-resources/plain-os/plain-os/plainos
CONFIG_TOPDIR := .
CROSS_COMPILE := arm-none-eabi-
CC := $(CROSS_COMPILE)gcc
OBJDUMP := $(CROSS_COMPILE)objdump
CP := $(CROSS_COMPILE)objcopy
SIZE := $(CROSS_COMPILE)size
OPTIMIZE := -O3
DEBUG :=  
ARCH := arm32
MCU := -mcpu=cortex-m4
CHIP := gd32f407vet6
CONFIG_PL_FLASH_SIZE = 524288
CONFIG_PL_SRAM_SIZE = 196608
CONFIG_PL_APPS = y
LIB_DIR := ./lib
CONFIG_PL_LIB = y
CONFIG_PL_LIB_STRING = y
CONFIG_PL_LIB_FFT256 = y
C_SRCS += $(LIB_DIR)/string/string.c
C_SRCS += $(LIB_DIR)/fft/fft256.c
KERNEL_DIR := ./kernel
CONFIG_PL_ASSERT = n
CONFIG_PL_OS_CHAR_LOGO = y
CONFIG_PL_TASK_PRIORITIES_MAX = 64
CONFIG_PL_SYS_RSVD_HIGHEST_PRIOTITY = 3
CONFIG_PL_SYSTICK_TIME_SLICE_US = 15
CONFIG_PL_DEFAULT_MEMPOOL_SIZE = 65536
CONFIG_PL_DEFAULT_MEMPOOL_GRAIN_ORDER = 5
CONFIG_PL_MAX_TASKS_NUM = 900
CONFIG_PL_INIT_TASK_STACK_SIZE = 512
CONFIG_PL_IDLE_TASK_STACK_SIZE = 512
CONFIG_PL_CPU_RATE_INTERVAL_TICKS = 10240
CONFIG_PL_CHECK_STACK_OVERFLOW = n
CONFIG_PL_CHECK_STACK_OVERFLOW_MAGIC = n
CONFIG_PL_KFIFO = y
CONFIG_PL_SOFT_TIMER = y
CONFIG_PL_SOFT_TIMER_DAEMON_STACK_SIZE = 512
CONFIG_PL_HP_WORKQUEUE_TASK_STACK_SIZE = 512
CONFIG_PL_HP_WORKQUEUE_FIFO_CAPACITY = 128
CONFIG_PL_LP_WORKQUEUE = y
CONFIG_PL_LP_WORKQUEUE_TASK_STACK_SIZE = 512
CONFIG_PL_LP_WORKQUEUE_TASK_PRIORITY = 64
CONFIG_PL_LP_WORKQUEUE_FIFO_CAPACITY = 128
CONFIG_PL_COMPLETTION = n
CONFIG_PL_SYSLOG = y
CONFIG_PL_SYSLOG_ANSI_COLOR = y
C_SRCS += $(KERNEL_DIR)/common.c
C_SRCS += $(KERNEL_DIR)/panic.c
C_SRCS += $(KERNEL_DIR)/entry.c
C_SRCS += $(KERNEL_DIR)/inittask.c
C_SRCS += $(KERNEL_DIR)/idletask.c
C_SRCS += $(KERNEL_DIR)/initcall.c
C_SRCS += $(KERNEL_DIR)/list.c
C_SRCS += $(KERNEL_DIR)/mempool.c
C_SRCS += $(KERNEL_DIR)/task.c
C_SRCS += $(KERNEL_DIR)/workqueue.c
C_SRCS += $(KERNEL_DIR)/semaphore.c
C_SRCS += $(KERNEL_DIR)/syslog.c
C_SRCS += $(KERNEL_DIR)/kfifo.c
C_SRCS += $(KERNEL_DIR)/softtimer.c
DRV_DIR := ./drivers
CONFIG_PL_DRIVERS = y
CONFIG_PL_DRIVERS_IOMUX = n
CONFIG_PL_DRIVERS_GPIO = n
CONFIG_PL_DRIVERS_SERIAL = y
C_SRCS += ./drivers/serial/serial.c
ARCH_DIR := ./arch
DEFINE += -DGD32F40_41xxx -D__CHECK_DEVICE_DEFINES
TEMP_FLAGS += $(DEFINE) -mthumb -Wall --specs=nosys.specs -Wextra -Wwrite-strings -Wformat=2
TEMP_FLAGS += -Werror=format-nonliteral -Wvla -Wlogical-op -Wshadow -Wformat-signedness
TEMP_FLAGS += -Wformat-overflow=2 -Wformat-truncation -Werror -Wmissing-declarations
TEMP_FLAGS += -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall
TEMP_FLAGS += -Werror=all -Werror=unused-function -Werror=unused-variable -Werror=deprecated-declarations
TEMP_FLAGS += -Wextra -Werror=unused-parameter -Werror=sign-compare  -gdwarf-4 -ggdb -nostartfiles
TEMP_FLAGS += -fstrict-volatile-bitfields -Werror=unused-but-set-variable -fno-jump-tables
TEMP_FLAGS += -fno-tree-switch-conversion
C_FLAGS += $(TEMP_FLAGS) -xc -Wmissing-prototypes -Werror=old-style-declaration -std=c11
CXX_FLAGS += $(TEMP_FLAGS) -xc++ -std=c++14
ASM_FLAGS += -x assembler-with-cpp
LDFLAGS += -Wl,--gc-sections,--print-memory-usage -specs=nano.specs
LIBS += -lc -lm -lnosys
INC += -I$(TOPDIR)/arch/arm32/gd32f407vet6
LINK_SCRIPT := $(ARCH_DIR)/arm32/gd32f407vet6/gd32f407vet6.ld
ASM_SRCS += $(ARCH_DIR)/arm32/gd32f407vet6/startup_gd32f407vet6.S
ASM_SRCS += $(ARCH_DIR)/arm32/gd32f407vet6/gd32f407vet6_port_asm.S
C_SRCS += $(ARCH_DIR)/arm32/gd32f407vet6/gd32f407vet6_port.c
C_SRCS += $(ARCH_DIR)/arm32/gd32f407vet6/sys/sys.c
C_SRCS += $(ARCH_DIR)/arm32/gd32f407vet6/usart/usart.c
CONFIG_PL_DRIVERS_ARCH = y
CONFIG_PL_DRIVERS_ARCH_SERIAL = y
C_SRCS += $(ARCH_DIR)/arm32/gd32f407vet6/driver/serial.c
APPS_DIR := ./apps
CONFIG_PL_SHELL := y
CONFIG_PL_APP_BINS := y
CONFIG_PL_SHELL_PREFIX_NAME = "plsh"
CONFIG_PL_SHELL_CMD_BUFF_MAX = 512
CONFIG_PL_SHELL_CMD_ARGC_MAX = 64
CONFIG_PL_SHELL_CMD_EXEC_TASK_PRIORITY = 64
CONFIG_PL_SHELL_CMD_EXEC_TASK_STACK_SIZE = 512
C_SRCS += $(APPS_DIR)/shell/shell.c
BINS_DIR := ./apps/bins
CONFIG_PL_BINS_APP1 := y
CONFIG_PL_BINS_LS := y
CONFIG_PL_BINS_CLEAR := y
CONFIG_PL_BINS_REBOOT := y
C_SRCS += $(BINS_DIR)/app1.c
C_SRCS += $(BINS_DIR)/pl_ls.c
C_SRCS += $(BINS_DIR)/pl_clear.c
C_SRCS += $(BINS_DIR)/pl_reboot.c
OSTEST_DIR := ./test
CONFIG_PL_OS_TEST_MEMPOOL := y
CONFIG_PL_OS_TEST_TASK := y
CONFIG_PL_OS_TEST_SOFTTIMER := y
CONFIG_PL_OS_TEST_KFIFO := y
CONFIG_PL_OS_TEST_WORKQUEUE := y
C_SRCS += $(OSTEST_DIR)/mempool_test.c
C_SRCS += $(OSTEST_DIR)/task_test.c
C_SRCS += $(OSTEST_DIR)/stimer_test.c
C_SRCS += $(OSTEST_DIR)/kfifo_test.c
C_SRCS += $(OSTEST_DIR)/workqueue_test.c
